from  random import choice

cave_numbers=range(1,21)
wumpus_location=choice(cave_numbers)
player_location=choice(cave_numbers)
while player_location==wumpus_location:
    player_location=choice(cave_numbers)

print "welcome to hunt the wumpus"
print "you can see",len(cave_numbers),"caves"
print "to play,just type the number"
print "of the cave you wish to enter next"

while True:
    print "you are in cave",player_location
    if(player_location==wumpus_location-1 or player_location==wumpus_location+1):
        print "i smell a wumpus!"

    print "which cave next?"
    player__input=raw_input(">")
    if(not player__input.isdigit() or int(player__input) not in cave_numbers):
        print player__input,"is not a cave!"

    else:
        player_location=int(player__input)
        if player_location==wumpus_location:
            print "you get eaten by a wumpus!"
            break